﻿<phone:PhoneApplicationPage
    x:Class="DnD.GamePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:google="clr-namespace:Google.AdMob.Ads.WindowsPhone7.WPF;assembly=Google.AdMob.Ads.WindowsPhone7"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="False"
    Style="{StaticResource TransitionPageStyle}">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" >
        <Grid.RowDefinitions>
            <RowDefinition Height="10"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="10"/>
        </Grid.RowDefinitions>
        <Grid.Background>
            <ImageBrush  Stretch="None"  ImageSource="{Binding  BackGroundImageSource}" />
        </Grid.Background>

        <Canvas Name="CanvasGrid" Grid.Row="1" >

            <Canvas.Resources>
                <Storyboard x:Name="StoryBoardMoveCardIn">
                    <DoubleAnimation From="500" To="20" Duration="0:0:1" Storyboard.TargetName="CardItem" Storyboard.TargetProperty="(Canvas.Left)" >
                        <DoubleAnimation.EasingFunction>
                            <CubicEase EasingMode="EaseInOut"></CubicEase>
                        </DoubleAnimation.EasingFunction>

                    </DoubleAnimation>
                </Storyboard>
                <Storyboard x:Name="StoryBoardMoveCardOut">
                    <DoubleAnimation From="{Binding CardItemPosition}" To="-500" Duration="0:0:1" Storyboard.TargetName="CardItem" Storyboard.TargetProperty="(Canvas.Left)" >
                        <DoubleAnimation.EasingFunction>
                            <CubicEase EasingMode="EaseInOut"></CubicEase>
                        </DoubleAnimation.EasingFunction>

                    </DoubleAnimation>
                </Storyboard>
            </Canvas.Resources>
            <Canvas.Background>
                <SolidColorBrush x:Name="CanvasBackground" Color="Transparent" />
            </Canvas.Background>
            <Border ManipulationStarted="CardItem_ManipulationStarted" ManipulationDelta="CardItem_ManipulationDelta" CornerRadius="30" x:Name="CardItem" Canvas.Left="{Binding CardItemPosition, Mode=TwoWay}"   Grid.Row="1" Width="450" Height="780" BorderThickness="5" BorderBrush="{StaticResource BorderColor}" Background="{StaticResource BackgroundColor}"  >
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="700" />
                        <RowDefinition  />
                    </Grid.RowDefinitions>

                    <StackPanel Grid.Row="0">
                        <TextBlock Text="{Binding SelectedCard.Name}"  Height="70" Style="{StaticResource CardHeaderTextStyle}"/>
                        <!--<Border BorderBrush="{StaticResource BorderColor}" Background="{StaticResource BackgroundColor}" BorderThickness="5" >-->
                        <Image Source="{Binding SelectedCard.PictureURL}" Height="340" Width="435" Stretch="UniformToFill" />
                        <!--</Border>-->
                        <ListBox   ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Disabled" ItemsSource="{Binding Actions}" >
                            <ListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel    Orientation="Horizontal"/>
                                </ItemsPanelTemplate>
                            </ListBox.ItemsPanel>
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal" >
                                        <Border  Margin="2"   CornerRadius="10"   BorderThickness="3" Width="50" Height="50" BorderBrush="{StaticResource BorderColor}" Background="{StaticResource BorderColor}">
                                            <Image Source="{Binding PictureURL}"  Width="48" Height="48" Stretch="UniformToFill" />
                                        </Border>
                                        <TextBlock  Text="X" VerticalAlignment="Center" Style="{StaticResource CardDescTextStyle}"  />
                                        <TextBlock  Text="{Binding Amount}" VerticalAlignment="Center" Style="{StaticResource CardActionAmountTextStyle}"  />
                                    </StackPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                        <TextBlock Text="{Binding SelectedCard.Description}"  Height="260" TextWrapping="Wrap"/>
                    </StackPanel>
                    <Border Grid.Row="1"  HorizontalAlignment="Left" Background="{StaticResource BorderColor}"  Opacity="0.9" Margin="0,0,0,0" BorderThickness="0" CornerRadius="0,0,0,30">
                        <Button Grid.Row="1" Command="{Binding NextCardCommand}"  Content=" &#xe112;" FontFamily="Segoe UI Symbol" FontSize="30"  BorderThickness="0" HorizontalAlignment="Right"  Width="100" >

                        </Button>
                    </Border>
                    <!--google:BannerAd Grid.Row="1"
    xmlns:google="clr-namespace:Google.AdMob.Ads.WindowsPhone7.WPF;assembly=Google.AdMob.Ads.WindowsPhone7"
    AdUnitID="a151e46862922c0" />-->
                </Grid>
            </Border>

        </Canvas>



    </Grid>

</phone:PhoneApplicationPage>